/*!
 * \file pres_parser.h
 *
 * \brief a namespace to allow the user to make use of the parser
 *
 * \date Started: 5/17/2010
 * \date Last Modified: 6/28/2010
 * \authors Michelle Strout Alan LaMielle Nicholas Jeanette
 *
 * Copyright (c) 2010, Colorado State University <br>
 * All rights reserved. <br>
 * See ../../COPYING for details. <br>
*/

#include <string>
#include <iegenlib/iegenlib.h>
#include <stack>

#ifndef PRES_PARSER_H
#define PRES_PARSER_H

/*!
    The pres_parser namespace hides the set and relation lexer and parser 
    functions and associated global variables.
*/
namespace iegenlib{ namespace pres_parser{
   //! Used by lexer to obtain each character of input string being parsed.
   int string_get_next_char();

   /*!parser_set passes a string representation of a set to the parser and a
   ParseSet gets created.
   @param string set string that is to be parsed
   @return Null pointer if error occurs or a relation is returned
   @return PresSet pointer when parsing is successful
   */
   PresSet* parse_set(string set_string);

   /*! getter for the parse_set_result
   @return PresSet parse_set_result */
   PresSet get_parse_set_result();

   /*! setter for the parse_set_result
   @param PresSet parse_set_result */
   void set_parse_set_result(PresSet* s);

   /*! passes a relation string into the parser and creates the PresRelation
   @param string relation string that is to be parsed
   @return Null pointer if error occurs or a set is returned
   @return PresRelation pointer when parsing is successful */
   PresRelation* parse_relation(string relation_string);

   /*! getter for the parse_relation_result
   @return PresRelation parse_relation_result */
   PresRelation get_parse_relation_result();

   /*! setter for the parse_relation_result
   @param PresRelation parse_relation_result */
   void set_parse_relation_result(PresRelation* s);

   /*! sets the parse_error flag to true */
   void set_parse_error(string err);

   /*! getter for the parse_error flag
   @return bool parse_error */
   bool get_parse_error();

   /*! clearAll frees (if needed) and resets the parse_relation_result and the
   parse_set_result so no data is left in those variables*/
   void clearAll();

}}//end namespace iegenlib::pres_parser

#endif
